﻿
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Text;

namespace Wlmy.Ids4.Common
{
    public class StaticInfo
    {
        public static IServiceProvider ServiceProvider { get; set; }
        public static HttpContext HttpContext => (ServiceProvider?.GetService(typeof(IHttpContextAccessor)) as IHttpContextAccessor).HttpContext;
        public static T GetService<T>() where T : class
        {
            return HttpContext.RequestServices.GetService(typeof(T)) as T;
        }
    }
}
